﻿<?xml version="1.0" encoding="utf-8" ?>
<hibernate-mapping xmlns="urn:nhibernate-mapping-2.2"
	namespace="Buaya.Model" assembly="Buaya.Core">

	<class name="TaxCode" table="tax_codes">
		<id name="Id">
			<generator class="native"/>
		</id>
		<property name="Code"/>
		<property name="Description"/>
		<property name="PersonalExemption"/>
		<property name="Inactive"/>
		<bag name="Ranges" inverse="true" cascade="all-delete-orphan">
			<key column="TaxCodeId"/>
			<one-to-many class="TaxSalaryRange"/>
		</bag>
	</class>

	<class name="TaxSalaryRange" table="tax_salary_ranges">
		<id name="Id">
			<generator class="native"/>
		</id>
		<many-to-one name="TaxCode" class="TaxCode" column="TaxCodeId"/>
		<property name="MonthlyStartSalary"/>
		<property name="MonthlyEndSalary"/>
		<property name="MonthlyBaseTax"/>
		<property name="SemiMonthlyStartSalary"/>
		<property name="SemiMonthlyEndSalary"/>
		<property name="SemiMonthlyBaseTax"/>
		<property name="PercentOver"/>
	</class>

</hibernate-mapping>
